#ifndef _PortalHud_H_
#define _PortalHud_H_

#include "common.h"

#include <sys/time.h>

#include "TextRender.h"
#include "DrawableImage.h"

#include "wiisprite.h"

using namespace Common;
using namespace wsp;

class PortalHud
{
	public:
		PortalHud();
		~PortalHud();
	
		int GetTotalCakes(){return _totalCakes;}
		int GetCakeObtained(){return _cakeObtained;}
		
		int GetPortalsSpawned(){return _portalsSpawned;}
		
		void SetTotalCakes(int t){_totalCakes = t;}
		void SetCakeObtained(int c){_cakeObtained = c;}
		
		void SetPortalsSpawned(int p){_portalsSpawned = p;}
		void PortalSpawned(){_portalsSpawned++;}
	
		void InitTime(){gettimeofday(&_ms, NULL); tic = 0;}
		
		long GetTimeElapsed();
		
		void Render();
	
		GameMode::Type GetMode(){return _gameMode;}
		
		void SetGameMode(GameMode::Type gm ){_gameMode = gm;}
	
		void UpdateTime();
	private:
		int _totalCakes;
		int _cakeObtained;
		
		int _portalsSpawned;
		
		//Time data
		struct timeval _ms;
		struct timeval _msEnd;
		
		long tic;
		
		GameMode::Type _gameMode;
		
		//Text stuff
		DrawableImage* _textImage;
		DrawableImage* _textImage2;
		TextRender* _textRender;
		Sprite _textSprite;
		
		Image* _hudCakeImage;
		Image* _hudScoreImage;
		Image* _hudScoreTimeImage;
		
		Sprite _hudCakeSprite;
		Sprite _hudScoreSprite;
		
};

#endif //_PortalHud_H_
